import { get,post } from './request'

const HttpManager= {
    getPass:()=>get('/task/isPass'),

    /* user */

    /** param userEmail,userPassword
     *  response user */
    postLogIn:(param)=>post('/user/login',param),
    /** param User*/
    postRegister:(param)=>post('/user/register',param),




    /* task */
    /** param */
    postInsertTask:(param)=>post('/task/addTask',param),
    /** param userId */
    getAllTasks:(param)=>post('/task/allTask',param),
    /** param n,userId*/
    getTasksByParam:(param)=>post('/task/getTaskByDate',param),
    /** param
     * task{
     *      taskId,taskTitle,taskDescription,
     *      taskStatus,taskGmtStart,taskGmtOver,
     *      taskGmtCreate,taskGmtUpdate,taskVersion,
     *      taskDeleted,userId
     *      }*/
    insertTask:(param)=>post('/task/addTask',param),
    /** param tasks*/
    updateTasks:(param)=>post('/task/updateTaskByTasks',param),
    /** param taskId*/
    deleteTask:(param)=>post('/task/deleteTask',param),
    /** param n:(-1,0,1) */
    getTasksByMonth:(param)=>post('/task/getTaskByMonthOnCalendar',param),



    /* Email */
    /** param emailAddress*/
    postMail:(param)=>post('/Email/sendEmailVerificationCode',param),
    /** param verificationCode*/
    postVerificationCode:(param)=>post('/Email/verificationEmail',param),


    /* Habit */
    getHabitsById:(params)=>post('/hTask/allHTask',params),
    insertHabit:(params)=>post('/hTask/addHTask',params),



    /* HabitSign */
    getSigns:(params)=>post('/hTaskSignIn/getSignInByHTaskId',params),
    insertSign:(params)=>post('/hTaskSignIn/addSignIn',params)

}

export {HttpManager}
